package ms.utils;

import ms.jasim.model.NamedModelObject;

import org.eclipse.emf.ecore.InternalEObject;


public class EModelObjectContainmentEList<E extends NamedModelObject> extends ENamedObjectContainmentEList<E> {

	private static final long serialVersionUID = 1L;

	public EModelObjectContainmentEList(Class<?> dataClass,
			InternalEObject owner, int featureID) {
		super(dataClass, owner, featureID);
	}

	@Override
	public boolean remove(Object object) {
		if (object instanceof NamedModelObject)
			if (((NamedModelObject) object).isPredefined()) return false;
		return super.remove(object);
	}
	
	@Override
	public E remove(int index) {
		if (get(index) instanceof NamedModelObject)
			if (get(index).isPredefined()) return null;
		return super.remove(index);
	}
}
